typedef bit[WID_SMEM_PAR - 1:0] vpar_t;
typedef bit[WID_DCHE_ASO - 1:0] vaso_t;
typedef bit[WID_DCHE_IDX - 1:0] vidx_t;
typedef bit[WID_DCHE_CL - 1:0] vcl_t;
typedef bit[WID_SMEM_BK - 1:0] vbk_t;
typedef bit[WID_WORD - 1:0] vos_t;
typedef bit[WID_LSV_RBUF-2:0] vlsbid_t;

typedef enum bit[2:0] {
  vpage_min   = 0,
  vpage_8x    = 1,
  vpage_64x   = 2,
  vpage_512x  = 3,
  vpage_2mx   = 4,
  vpage_8mx   = 5,
  vpage_max   = 6
} vpage_typ_e;

typedef bit[WID_PGMSK - 1:0] vpageMsk_t;

typedef struct packed unsigned{
  bit[WORD_BITS - WID_NVADR - WID_PGMSK - 1:0] v2;
  vpageMsk_t msk;
} vvpn_t;

typedef enum uchar {
	vmemst_byte,  	vmemst_half,  	vmemst_word,    	vmemst_cond
}vmemst_e;

typedef enum uchar {
	vmemld_byte,  	vmemld_ubyte,	  vmemld_half,    	vmemld_uhalf,
	vmemld_word,  	vmemld_link
}vmemld_e;

class tr_isu2lsu extends uvm_sequence_item;
  rand ushort adr;
  rand bit vec, dw, wr;
  rand uchar ltid;
  rand uchar lid;
  rand bit ls, lg, asyn;
  rand vmemst_e st;
  rand vmemld_e ld;
  rand uchar gid, ch, oid;
  event start;
  
  constraint va{
    dw == '0;
    wr == '1;
    vec == '1;
    ch < 4;
    adr < 32;
    ltid < NUM_THRD;
    lid < NUM_LANE;
    oid < NUM_ISU_OCNT;
  };
  
  `uvm_object_utils_begin(tr_isu2lsu)
    `uvm_field_int(adr, UVM_ALL_ON)
    `uvm_field_int(vec, UVM_ALL_ON)
    `uvm_field_int(dw, UVM_ALL_ON)
    `uvm_field_int(wr, UVM_ALL_ON)
    `uvm_field_int(asyn, UVM_ALL_ON)
    `uvm_field_int(ltid, UVM_ALL_ON)
    `uvm_field_int(lid, UVM_ALL_ON)
    `uvm_field_int(ls, UVM_ALL_ON)
    `uvm_field_int(lg, UVM_ALL_ON)
    `uvm_field_int(gid, UVM_ALL_ON)
    `uvm_field_int(ch, UVM_ALL_ON)
    `uvm_field_int(oid, UVM_ALL_ON)
    `uvm_field_enum(vmemst_e, st, UVM_ALL_ON)
    `uvm_field_enum(vmemld_e, ld, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_isu2lsu");
  	super.new(name);
	endfunction : new
endclass

class tr_lsu2rfu extends uvm_sequence_item;
  rand uchar adr;
  rand bit crfw;
  rand bit v[NUM_VEC];
  rand uint data[NUM_VEC], flag;
  
  constraint va{
    adr < 32;
  };
  
  `uvm_object_utils_begin(tr_lsu2rfu)
    `uvm_field_int(adr, UVM_ALL_ON)
    `uvm_field_int(crfw, UVM_ALL_ON)
    `uvm_field_int(flag, UVM_ALL_ON)
    `uvm_field_sarray_int(v, UVM_ALL_ON)
    `uvm_field_sarray_int(data, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_lsu2rfu");
  	super.new(name);
	endfunction : new
endclass

class tr_lsu2dcu0 extends uvm_sequence_item;
  rand bit ls, sm;
  rand uint adr[NUM_VEC];
  rand bit v[NUM_VEC*WORD_BYTES];
  rand ushort arid;
  rand uint chadr;

  constraint va{
    foreach(adr[i])
      adr[i] < (1'b1 << $bits(smadr_t));
    chadr < (1'b1 << $bits(vadr_t));
    arid < NUM_LSV_SBUF;
  };
  
  `uvm_object_utils_begin(tr_lsu2dcu0)
    `uvm_field_int(ls, UVM_ALL_ON)
    `uvm_field_int(sm, UVM_ALL_ON)
    `uvm_field_int(arid, UVM_ALL_ON)
    `uvm_field_int(chadr, UVM_ALL_ON)
    `uvm_field_sarray_int(adr, UVM_ALL_ON)
    `uvm_field_sarray_int(v, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_lsu2dcu0");
  	super.new(name);
	endfunction : new
endclass

class tr_lsu2dcu1 extends uvm_sequence_item;
  rand uchar data[NUM_VEC*WORD_BYTES];
  rand ushort did;  
  
  constraint va{
    did < NUM_LSV_SBUF;
  };
  
  `uvm_object_utils_begin(tr_lsu2dcu1)
    `uvm_field_int(did, UVM_ALL_ON)
    `uvm_field_sarray_int(data, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_lsu2dcu1");
  	super.new(name);
	endfunction : new
endclass

class tr_rfu2lsu extends uvm_sequence_item;
  rand uint imm;
  rand uint d[NUM_VEC], b[NUM_VEC];
  rand bit v[NUM_VEC];
  
  constraint va{
    (imm & 'hfffff800) == '0;
    foreach(v[i])
      v[i] dist {1:=9, 0:=1};
  };
  
  `uvm_object_utils_begin(tr_rfu2lsu)
    `uvm_field_int(imm, UVM_ALL_ON)
    `uvm_field_sarray_int(d, UVM_ALL_ON)
    `uvm_field_sarray_int(b, UVM_ALL_ON)
    `uvm_field_sarray_int(v, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_rfu2lsu");
  	super.new(name);
	endfunction : new
endclass

class tr_dcu2lsu0 extends uvm_sequence_item;
  rand uchar data[NUM_VEC*WORD_BYTES];
  rand bit ldexp[NUM_VEC];
  rand ushort did;
  rand uchar delay;
  
  constraint va{
    did < NUM_LSV_SBUF;
    delay inside {[0:6]};
    foreach(ldexp[i])
      ldexp[i] dist {0:=9, 1:=1};
  };
  
  `uvm_object_utils_begin(tr_dcu2lsu0)
    `uvm_field_int(delay, UVM_ALL_ON)
    `uvm_field_int(did, UVM_ALL_ON)
    `uvm_field_sarray_int(data, UVM_ALL_ON)
    `uvm_field_sarray_int(ldexp, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_dcu2lsu0");
  	super.new(name);
	endfunction : new
endclass

class tr_dcu2lsu1 extends uvm_sequence_item;
  rand bit sexp[NUM_VEC];
  rand ushort sid;
  rand uchar delay;
  
  constraint va{
    sid < NUM_LSV_SBUF;
    delay inside {[0:6]};
    foreach(sexp[i])
      sexp[i] dist {0:=9, 1:=1};
  };
  
  `uvm_object_utils_begin(tr_dcu2lsu1)
    `uvm_field_int(delay, UVM_ALL_ON)
    `uvm_field_int(sid, UVM_ALL_ON)
    `uvm_field_sarray_int(sexp, UVM_ALL_ON)
  `uvm_object_utils_end

	function new (string name = "tr_dcu2lsu1");
  	super.new(name);
	endfunction : new
endclass